package org.jackysoft.mapper;

import java.util.Collection;

import org.jackysoft.data.MapperDataProvider;
import org.jackysoft.entity.OsStep;
import org.jackysoft.entity.OsWorkflowRunner;

public interface OsWorkflowRunnerMapper extends
		MapperDataProvider<OsWorkflowRunner> {
    void setHtmlTemplate(long refid,String tempid);
    
    void insertCurrentStep(OsStep step);
    void insertCurrentPrev(long id ,long prevId);
    
    OsStep findCurrentStep(long stepId);
    OsStep findHistoryStep(long stepId);
    
    void deleteCurrentStep(long stepId);
    void deleteHistoryStep(long stepId);
    
    
    String findStatusOfCurrentStep(long stepId);
    
    Collection<OsStep> findAllCurrentStepByRunner(long runner);
     
    void insertStepId();
    long selectStepId();
    
    
    
    Collection<OsStep> findAllHistoryStepByRunner(long runner);
    void moveToHistory(long stepId);
    
    void insertRunner(OsWorkflowRunner runner);
    
    OsWorkflowRunner findRunner(long id);
    void markFinished(long step, int actionId, long finishDate,
			String status, String caller);
    
    void updateState(long runnerId,int state);
    int findState(long runnerId);
    
    
    
    
    //////////////////////////////////////
    //*************************************
    //do rollback
    
    long  findCurrentPrevId(long curid);
    void  doRollbackStep(long curid,long hisid);
    
    
}
